<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script>
			function getD(){
				let d1=document.getElementById("d1");
				d1.align="right";
				//d1.innerHTML+="<a href='https://www.jd.com' target='_blank'>淘宝</a>";
				d1.innerText+="<a href='https://www.jd.com' target='_blank'>淘宝</a>";
			}
		</script>
	</head>
	<body>
		<div id="d1">
			你好
		</div>
		<div id="d1">
			Good morning
		</div>
		<div>
			大扎好，你是渣渣会
		</div>
		<p>
			<input type="button" value="获得d1元素" onclick="getD()" />
		</p>
	</body>
</html>